package algorithms.paixu;

public class meet25 {
    public static void main(String[] args) {
        int[] arr = {1,-2,3,2,4,1,-5};
        new meet25().sort(arr);
        System.err.println(arr);
        String a = "a<bdB";
        a.matches("[a-zA-Z]");
    }

    public void sort(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            for (int j = i;j<arr.length;j++) {
                if (mx(arr[i]) > mx(arr[j])) {
                    ex(arr,i,j);
                }
            }
        }
    }

    public int mx(int i) {
        return i >= 0 ? i : -i;
    }
    public void ex(int[] arr,int iInd,int jInd) {
        int tmp = arr[iInd];
        arr[iInd] = arr[jInd];
        arr[jInd] = tmp;
    }

}
